<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
<meta name="description"
	content="Source code generated using layoutit.com">
<meta name="author" content="LayoutIt!">

<link href="${basePath}bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="${basePath}bootstrap/css/style.css" rel="stylesheet">

<!-- 对表单验证提示信息进行格式设置 -->
<style type="text/css">
span {
	color: red;
}
</style>
<script src="${basePath}bootstrap/js/jquery.min.js"></script>
<script src="${basePath}bootstrap/js/bootstrap.min.js"></script>
<script src="${basePath}bootstrap/js/scripts.js"></script>
<!-- 进行表单验证 -->
<script type="text/javascript">
	//进行用户名非空验证
	function checkAccount() {
		//用户输入的用户名内容
		var txtAccount = document.getElementById("txtAccount").value;
		//错误提示信息
		var sptxtAccount = document.getElementById("spAccount");
		//进行用户名非空验证
		if (txtAccount == null || txtAccount == "") {
			//错误提示信息
			sptxtAccount.innerHTML = "请输入账号！";
			//改变标志量
			return false;
		} else {
			//清空错误提示信息
			sptxtAccount.innerHTML = "";
			//改变标志量
			return true;
		}
	}
	//进行密码非空验证
	function checkPsw() {
		//用户输入的密码内容
		var txtPsw = document.getElementById("txtPsw").value;
		//错误提示信息
		var sptxtPsw = document.getElementById("spPsw");
		//进行密码非空验证
		if (txtPsw == null || txtPsw == "") {
			//错误提示信息
			sptxtPsw.innerHTML = "请输入密码!";
			//改变标志量
			return false;
		} else {
			//清空错误提示信息
			sptxtPsw.innerHTML = "";
			//改变标志量
			return true;
		}
	}
	//身份选择验证
	function checkId() {
		var radId = document.getElementsByName("selectId");
		var chId = false;
		for (var i = 0; i < radId.length; i++) {
			if (radId[i].checked) {
				chId = true;
				break;
			}
		}
		var spid = document.getElementById("spid");
		if (!chId) {
			spid.innerHTML = "请选择身份！";
			return false;
		} else {
			spid.innerHTML = "";
			return true;
		}
	}
	//提交按钮验证
	function checkMe() {
		var ischAccount = checkAccount();
		var ischPsw = checkPsw();
		var ischId = checkId();
		if (ischAccount && ischPsw && ischId) {
			return true;
		} else {
			return false;
		}
	}
</script>
</head>
<body>
	<div id="container" align="center">
		<div style="width: 500px;" align="left">
			<h4 align="center">登录界面</h4>
			<form class="form-horizontal" role="form" action="logined.do"
				method="post">
				<div class="form-group">
					<label for="inputUserAccount" class="col-sm-2 control-label">账号</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="txtAccount"
							id="txtAccount" placeholder="账号" onblur="checkAccount();" />
						<div>
							<span id="spAccount"></span>
						</div>

					</div>
				</div>
				<div class="form-group">
					<label for="inputUserTel" class="col-sm-2 control-label">密&nbsp;&nbsp;&nbsp;&nbsp;码</label>
					<div class="col-sm-10">
						<input type="password" class="form-control" name="txtPsw"
							id="txtPsw" placeholder="密码" onblur="checkPsw();" />
						<div>
							<span id="spPsw"></span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label for="selectId" class="col-sm-2 control-label">身&nbsp;&nbsp;&nbsp;&nbsp;份</label>
					<div class="col-sm-10">
						<label class="radio-inline"> <input type="radio"
							name="selectId" id="selectId1" value="用户" onclick="checkId();">
							用户
						</label> <label class="radio-inline"> <input type="radio"
							name="selectId" id="selectId2" value="操作员" onclick="checkId();">
							操作员
						</label> <label class="radio-inline"> <input type="radio"
							name="selectId" id="selectId3" value="管理员" onclick="checkId();">
							管理员
						</label>
						<div>
							<span id="spid"></span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-default"
							onclick="return checkMe();">登录</button>
						<span class="font">${ErroLog}</span>
					</div>
				</div>
			</form>

		</div>
	</div>
</body>
</html>